package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._10观察者模式._1基本代码;

import java.util.ArrayList;

public class Test {

	public static void main(String[] args){

        Subject subject = new ConcreteSubject();
        subject.attach(new ConcreteObserver("NameX",subject));
        subject.attach(new ConcreteObserver("NameY",subject));
        subject.attach(new ConcreteObserver("NameZ",subject));
        subject.setSubjectState("ABC");

        subject.notifyObserver();


	}
}










